import request from '../utils/request';

export default {
    //  获取当前任务下布置的任务
    getWorkById(targetId) {
        return request({
            url: `/work/getByTargetId`,
            method: 'get',
            params: {
                targetId
            }
        });
    },
    addWorkByTargetId(targetId,Work){
        return request({
            url: `/work/addWork/${targetId}`,
            method: 'post',
            data: Work
        })
    },
    deleteWorkById(id){
        return request({
            url: `/work/delete`,
            method: 'delete',
            params: {
                id
            }
        })
    },
    getWorkByIdEdit(id){
        return request({
            url: `/work/get`,
            method: 'get',
            params: {
                id
            }
        })
    },
    editWorkById(id,Work){
        return request({
            url: `/work/update/${id}`,
            method: 'put',
            data: Work
        })
    }
}